using System;
using System.Collections.Generic;
using System.Threading.Tasks;
using UwinEducation.Application.Dtos;
using UwinEducation.Shared.Enums;
using UwinEducation.Shared.Models;

namespace UwinEducation.Application.Common.Interfaces
{
    /// <summary>
    /// 学生课表详情服务接口
    /// </summary>
    public interface IStudentScheduleDetailsService
    {
        /// <summary>
        /// 获取学生课表详情
        /// </summary>
        Task<StudentScheduleDetailsDto> GetByIdAsync(Guid id);

        /// <summary>
        /// 获取订单详情下的所有课表详情
        /// </summary>
        Task<List<StudentScheduleDetailsDto>> GetByOrderDetailIdAsync(Guid orderDetailId);

        /// <summary>
        /// 获取教师课表详情下的所有学生课表
        /// </summary>
        Task<List<StudentScheduleDetailsDto>> GetByTeacherScheduleDetailsIdAsync(Guid teacherScheduleDetailsId);

        /// <summary>
        /// 根据状态获取学生课表详情
        /// </summary>
        Task<List<StudentScheduleDetailsDto>> GetByStatusAsync(ScheduleStatus status);

        /// <summary>
        /// 获取指定时间范围内的学生课表详情
        /// </summary>
        Task<List<StudentScheduleDetailsDto>> GetByDateRangeAsync(Guid orderDetailId, DateTime startTime, DateTime endTime);

        /// <summary>
        /// 创建学生课表详情
        /// </summary>
        Task<StudentScheduleDetailsDto> CreateAsync(CreateStudentScheduleDetailsDto createDto);

        /// <summary>
        /// 批量创建学生课表详情
        /// </summary>
        Task<List<StudentScheduleDetailsDto>> CreateRangeAsync(List<CreateStudentScheduleDetailsDto> createDtos);

        /// <summary>
        /// 更新学生课表详情
        /// </summary>
        Task<StudentScheduleDetailsDto> UpdateAsync(UpdateStudentScheduleDetailsDto updateDto);

        /// <summary>
        /// 更新学生课表状态
        /// </summary>
        Task<StudentScheduleDetailsDto> UpdateStatusAsync(Guid id, ScheduleStatus status, string reason = null);

        /// <summary>
        /// 删除学生课表详情
        /// </summary>
        Task DeleteAsync(Guid id);

        /// <summary>
        /// 批量删除学生课表详情
        /// </summary>
        Task DeleteRangeAsync(List<Guid> ids);

        /// <summary>
        /// 检查时间冲突
        /// </summary>
        Task<bool> HasTimeConflictAsync(Guid orderDetailId, DateTime startTime, DateTime endTime, Guid? excludeId = null);

        /// <summary>
        /// 分页查询学生课表详情
        /// </summary>
        /// <param name="requestDto">分页请求</param>
        /// <returns>分页结果</returns>
        Task<PagedResult<StudentScheduleDetailsDto>> GetPagedAsync(StudentScheduleDetailsPageRequest requestDto);

        /// <summary>
        /// 获取教师课表集合
        /// </summary>
        Task<List<TeacherScheduleListDto>> GetTeacherScheduleListAsync(TeacherScheduleListRequest request);
    }
}